<?php

class App_adModel extends BaseModel
{
    var $table  = 'app_ad';
    var $prikey = 'ad_id';
    var $_name  = 'app_ad';

    function drop($conditions, $fields = 'ad_pic')
    {
        $droped_rows = parent::drop($conditions, $fields);
        if ($droped_rows)
        {
            restore_error_handler();
            $droped_data = $this->getDroppedData();
            foreach ($droped_data as $key => $value)
            {
                if ($value['ad_pic'])
                {
                    @unlink(ROOT_PATH . '/' . $value['ad_pic']);  //删除Logo文件
                }
            }
            reset_error_handler();
        }
        return $droped_rows;
    }

}

?>